Nuhman Paramban


@Nuhman Paramban

Run ImageMagick Shell Command in NodeJs for HEIC to JPEG Conversion

Easy way to call imagemagick image conversion for HEIC to JPEG (Or any other format) Use mogrify -format jpeg IMG_1882.HEIC
  1. Run npm install child_process
  2. create a .js file with any name and paste following and run node .js
const { exec } = require("child_process");

exec("mogrify -format jpg IMG_1882.HEIC", (error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`);
return;
}
if (stderr) {
console.log(`stderr: ${stderr}`);
return;
}
console.log(`stdout: ${stdout}`);
});